package com.yy.utils;

import org.springframework.stereotype.Component;

/**
 * create by KongFuning on 2022/8/2
 */
/*
* 基于ThreadLocal 封装工具类，用户保存和获取当前登录用户id
* */
public class BaseContext {
    private static ThreadLocal<String> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(String id){
        threadLocal.set(id);
    }

    public static String getCurrentId(){
        return threadLocal.get();
    }

}
